<?php
/**
 * JoiVideo - video gallery component for Joostina
 *
 * Backend controller
 *
 * @version 0.1
 * @package JoiVideo
 * @subpackage	Admin
 * @author JoostinaTeam
 * @copyright (C) 2007-2010 Joostina Team
 * @license see license.txt
 *
 **/

defined('_VALID_MOS') or die();

$act = mosGetParam($_REQUEST, 'act');

if (empty($act)) {
    return;
}
if ($act == 'configuration') {
    switch ($task) {

	case 'new':
	case 'config':
	    mosMenuBar::startTable();
	    mosMenuBar::apply();
	    mosMenuBar::spacer();
	    mosMenuBar::save();
	    mosMenuBar::spacer();
	    mosMenuBar::cancel();
	    mosMenuBar::endTable();
	    break;

	case 'config_list':
	default:
	    mosMenuBar::startTable();
	    mosMenuBar::addNew();
	    mosMenuBar::spacer();
	    mosMenuBar::deleteList();
	    mosMenuBar::endTable();
	    break;
    }
    return;
}
if ($act == 'extrafields') {
    switch ($task) {

	case 'new':
	case 'extrafield':
	    mosMenuBar::startTable();
	    mosMenuBar::apply();
	    mosMenuBar::spacer();
	    mosMenuBar::save();
	    mosMenuBar::spacer();
	    mosMenuBar::cancel();
	    mosMenuBar::endTable();
	    break;

	case 'extrafield_list':
	default:
	    mosMenuBar::startTable();
	    mosMenuBar::addNew();
	    mosMenuBar::spacer();
	    mosMenuBar::deleteList();
	    mosMenuBar::endTable();
	    break;
    }
    return;
}
if ($act == 'plugins') {
    switch ($task) {

	case 'plugin':
	    mosMenuBar::startTable();
	    mosMenuBar::save();
	    mosMenuBar::spacer();
	    mosMenuBar::cancel();
	    mosMenuBar::endTable();
	    break;

	case 'plugins_list':
	default:
	    mosMenuBar::startTable();
	    mosMenuBar::deleteList();
	    mosMenuBar::endTable();
	    break;
    }
    return;
}
if ($act == 'video') {
    switch ($task) {
	case 'new':
	    mosMenuBar::startTable();
	    mosMenuBar::custom('upload', 'upload.png', 'upload_f2.png', _C_JOIGALLERY_UP, false);
	    mosMenuBar::cancel('cancel', _C_JOIGALLERY_CLOSE);
	    mosMenuBar::endTable();
	    break;
	case 'edit':
	    mosMenuBar::startTable();
	    mosMenuBar::spacer();
	    mosMenuBar::save();
	    mosMenuBar::spacer();
	    mosMenuBar::apply();
	    mosMenuBar::spacer();
	    mosMenuBar::cancel();
	    mosMenuBar::endTable();
	    break;

	default:
	    mosMenuBar::startTable();
	    mosMenuBar::publishList();
	    mosMenuBar::unpublishList();
	    mosMenuBar::divider();
	    mosMenuBar::deleteListX();
	    mosMenuBar::spacer();
	    mosMenuBar::editListX();
	    mosMenuBar::spacer();
	    mosMenuBar::custom('new', 'upload.png', 'upload_f2.png', _C_JOIGALLERY_UP, false);
	    mosMenuBar::endTable();
	    break;
    }
    return;
}
switch ($task) {
    case 'new':
    case 'edit':
	mosMenuBar::startTable();
	mosMenuBar::spacer();
	mosMenuBar::save();
	mosMenuBar::spacer();
	mosMenuBar::apply();
	mosMenuBar::spacer();
	mosMenuBar::cancel();
	mosMenuBar::endTable();
	break;

    default:
	mosMenuBar::startTable();
	mosMenuBar::deleteListX();
	mosMenuBar::spacer();
	mosMenuBar::editListX();
	mosMenuBar::spacer();
	mosMenuBar::addNewX();
	mosMenuBar::endTable();
	break;
}
?>